import 'package:car_baidu/core/model/l_l_user_info_model_entity.dart';

lLUserInfoModelEntityFromJson(
    LLUserInfoModelEntity data, Map<String, dynamic> json) {
  if (json['headPicture'] != null) {
    data.headPicture = json['headPicture'].toString();
  }
  if (json['success'] != null) {
    data.success = json['success'];
  }
  if (json['count'] != null) {
    data.count = LLUserInfoModelCount().fromJson(json['count']);
  }
  if (json['nickname'] != null) {
    data.nickname = json['nickname'].toString();
  }
  if (json['autograph'] != null) {
    data.autograph = json['autograph'].toString();
  }
  return data;
}

Map<String, dynamic> lLUserInfoModelEntityToJson(LLUserInfoModelEntity entity) {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['headPicture'] = entity.headPicture;
  data['success'] = entity.success;
  data['count'] = entity.count?.toJson();
  data['nickname'] = entity.nickname;
  data['autograph'] = entity.autograph;
  return data;
}

lLUserInfoModelCountFromJson(
    LLUserInfoModelCount data, Map<String, dynamic> json) {
  if (json['collectCount'] != null) {
    data.collectCount = json['collectCount'] is String
        ? int.tryParse(json['collectCount'])
        : json['collectCount'].toInt();
  }
  if (json['dynamicCount'] != null) {
    data.dynamicCount = json['dynamicCount'] is String
        ? int.tryParse(json['dynamicCount'])
        : json['dynamicCount'].toInt();
  }
  if (json['commentCount'] != null) {
    data.commentCount = json['commentCount'] is String
        ? int.tryParse(json['commentCount'])
        : json['commentCount'].toInt();
  }
  return data;
}

Map<String, dynamic> lLUserInfoModelCountToJson(LLUserInfoModelCount entity) {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['collectCount'] = entity.collectCount;
  data['dynamicCount'] = entity.dynamicCount;
  data['commentCount'] = entity.commentCount;
  return data;
}
